﻿// ***********************************************************************************************
// <summary author="billq" create_date="2011-02-27" modify_date="">
//         服务总线接口定义
// </summary> 
// <modify_log>
//
// </modify_log>
// <copyright file="IServiceBus.cs" company="TRUMPSUN" url="http://www.trumpsun.com">
//           TRUMPSUN Studio
// </copyright>
// ***********************************************************************************************

namespace Qxado
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    /// <summary>
    /// 定义一个服务查找的方式
    /// </summary>
    public interface IServiceBus
    {
        /// <summary>
        /// 获取服务
        /// </summary>
        /// <param name="serviceName">服务名</param>
        /// <param name="serviceType">服务的类型，一般使用接口</param>
        /// <returns>服务对象</returns>
        object GetService(string serviceName, Type serviceType);

        /// <summary>
        /// 获取服务
        /// </summary>
        /// <param name="serviceName">服务名</param>
        /// <returns>服务对象</returns>
        object GetService(string serviceName);

        /// <summary>
        /// 获取服务
        /// </summary>
        /// <param name="serviceType">服务类型</param>
        /// <returns>服务对象</returns>
        object GetService(Type serviceType);

        /// <summary>
        /// 获取服务
        /// </summary>
        /// <typeparam name="T">服务类型</typeparam>
        /// <param name="serviceName">服务名</param>
        /// <returns>服务对象</returns>
        T GetService<T>(string serviceName);

        /// <summary>
        /// 获取服务
        /// </summary>
        /// <typeparam name="T">服务类型</typeparam>
        /// <returns>服务对象</returns>
        T GetService<T>();
    }
}
